package day6;

// 你继承谁你就是谁，继承是一种严格的父子关系
public class Student extends Person{
	// 在子类里面只要写子类特有是属性和方法
	private String className;
	
	public void study() {
		System.out.println("id是" + id + "的" + name + "正在" + className + "学习");
	}
	
	@Override
	public void show() {
		System.out.println("Student.show()");
	}
	

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}


	// 重写、覆盖，对从父类继承的方法不满意，所以重新定义
	@Override
	public String toString() {
		return "Student [id=" + id + ", name=" + name + ", age=" + age + ", gender=" + gender + ", className="
				+ className + "]";
	}



	
	

	
}
